home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF & Cyberdog / CyberStarter / Sources / Part.r < prev    next >
Encoding:
Text File  |  1996-08-16  |  6.9 KB  |  259 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                            Part.r
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #define SystemSevenOrBetter 1            // we want the extended types
  11. #define    SystemSevenOrLater    1            // Types.r uses this variable
  12.  
  13. #include "Types.r"
  14. #include "SysTypes.r"
  15. #include "CodeFragmentTypes.r"
  16.  
  17. #include "ODTypes.r"
  18. #include "Cyberdog.h"
  19. #include "FWBldDef.h"
  20. #include "Binding.h"
  21.  
  22. //-------------------------------------------------------------------------------------
  23. // cfrg Resource
  24. //-------------------------------------------------------------------------------------
  25.  
  26. resource 'cfrg' (0) {
  27.     {
  28.         //
  29.         // Fully qualified Name (SOMMODULE::SOMCLASS)
  30.         //
  31. #ifdef FW_BUILD_MAC68K
  32.         kMotorola,
  33. #else
  34.         kPowerPC,
  35. #endif
  36.         kFullLib, kNoVersionNum, kNoVersionNum, kDefaultStackSize, kNoAppSubFolder, kIsLib, kOnDiskFlat, kZeroOffset, kWholeFork,
  37.         kEditor,
  38.  
  39.         //
  40.         // Partially qualified Name (SOMCLASS only) 
  41.         // Otherwise identical to above
  42.         //
  43. #ifdef FW_BUILD_MAC68K
  44.         kMotorola,
  45. #else
  46.         kPowerPC,
  47. #endif
  48.         kFullLib, kNoVersionNum, kNoVersionNum, kDefaultStackSize, kNoAppSubFolder, kIsLib, kOnDiskFlat, kZeroOffset, kWholeFork,
  49.         "ODFCyberStarter"
  50.     }
  51. };
  52.  
  53. //-------------------------------------------------------------------------------------
  54. // NMAP Constants
  55. //-------------------------------------------------------------------------------------
  56.  
  57. #define kKindCategoryMapId            128
  58. #define kEditorKindMapId            129
  59. #define kEditorUserStringMapId        130
  60. #define kKindUserStringMapId        131
  61. #define kCategoryUserStringMapId    132
  62. #define kOldMacOSTypeMapId            133
  63. #define kEditorPlatformKinds        134
  64.  
  65. //-------------------------------------------------------------------------------------
  66. // NMAP Resources
  67. // 
  68. // kODEditorKinds            What kinds can this part open? (both OpenDoc and MIME)
  69. // kODKindOldMacOSType        What icon to use for each kind?
  70. // kODEditorPlatformKind    What mac files can be translated to this part?
  71. // kODKind                    Why category does this parts kinds belong to?
  72. // kODEditorUserString        English/etc name for the part.
  73. // kODKindUserString        English/etc name for the kind.
  74. // kODCategoryUserString    English/etc name for the category (if non-standard).
  75. //-------------------------------------------------------------------------------------
  76.  
  77. // These depend on the binding information (Binding.h)
  78. #define kCyberKindID     kODISOPrefix kMimeType
  79.  
  80. // A CyberItem (X) which points to some item (Y) will have the
  81. // same data kind as Y, only with "Apple:Cyberdog:Kind:CyberItem:MIME:" in 
  82. // the middle. We never really need to deal with this, except in the 
  83. // kODKindOldMacOSType namp, where we specify which icon to use for the
  84. // CyberItem.
  85. #define kURLKind        kODISOPrefix "Apple:Cyberdog:Kind:CyberItem:MIME:" kMimeType
  86.  
  87. resource kODNameMappings (kKindCategoryMapId) {
  88.     kODKind, {
  89.     //
  90.     // What "categories" does our part data fall into?
  91.     // This information is only used to group editors in Editor Setup and
  92.     // the Document Info window and isn't used during part binding.
  93.     //
  94.         kKind, kODIsAnISOStringList {{
  95.             kCategory
  96.         }}
  97.     }
  98. };
  99.  
  100. resource kODNameMappings (kEditorKindMapId) {
  101.     kODEditorKinds, {
  102.     //
  103.     // ****IMPORTANT*****
  104.     // What kinds of data will be opened by this editor?
  105.     // If you list a data type here then OpenDoc will open your part when
  106.     // it sees that kind of data.
  107.     // You ****MUST**** list your data kinds here to get your part opened by Cyberdog.
  108.     // If OpenDoc has multiple parts for the same kind of data, then it will
  109.     // use Editor Setup to decide which part to use. But if your part is the only one
  110.     // then you don't need to bother with Editor Setup.
  111.     //
  112.         kEditor, kODIsAnISOStringList {{
  113.             kKind,                    // OpenDoc data kind
  114.             kMIMEPrefix kMimeType,    // Cyberdog data kind 
  115.             kCyberPartKind             // this is a hack required by Cyberdog
  116.         }}
  117.     }
  118. };
  119.  
  120. resource kODNameMappings (kEditorUserStringMapId) {
  121.     kODEditorUserString, {
  122.         kEditor, kODIsINTLText {
  123.             smRoman, langEnglish, "ODF CyberStarter R1"
  124.         }
  125.     }
  126. };
  127.  
  128. resource kODNameMappings (kKindUserStringMapId) {
  129.     kODKindUserString, {
  130.         kKind, kODIsINTLText {
  131.             smRoman, langEnglish, "Text"
  132.         },
  133.         kCyberKindID, kODIsINTLText {
  134.             smRoman, langEnglish, "Location of Text"
  135.         }
  136.     }
  137. };
  138.  
  139. #if 0
  140.  
  141. resource kODNameMappings (kCategoryUserStringMapId) {
  142.     kODCategoryUserString, {
  143.     //
  144.     // This string is displayed in the Editor Setup control panel. It describes
  145.     // the group that your data kind(s) belong(s) to.
  146.     // For instance: A Postscript kind belongs to the Text, Image, and Program categories.
  147.     // Don't specify a CategoryUserString if you are using a standard OpenDoc category
  148.     // (kODCategory...) (hence the #if 0 around this entry)
  149.     // You should REALLY REALLY try to use a standard one (they are defined in <StdDefs.xh>)
  150.     // If you have a custom category then change the #if 0 to a #if 1 above.
  151.     //
  152.         kCategory, kODIsINTLText {
  153.             smRoman, langEnglish, "New Stuff"
  154.         }
  155.     }
  156. };
  157.  
  158. #endif
  159.  
  160. resource kODNameMappings (kOldMacOSTypeMapId) {
  161.     kODKindOldMacOSType, {
  162.         //
  163.         // Icons
  164.         // These are used only to determine what icon the finder displays for your
  165.         // OpenDoc document and URL file (a.k.a. Cyberdog "CyberItem") in the Notebook.
  166.         // These OSTypes are not related to binding and should be unique!
  167.         //
  168.         kKind,             kODIsMacOSType { kDocumentIcon },
  169.         kURLKind,         kODIsMacOSType { kURLIcon }
  170.     }
  171. };
  172.  
  173. resource kODNameMappings (kEditorPlatformKinds) {
  174.     kODEditorPlatformKind, {
  175.     //
  176.     // Data Translation
  177.     // If you want your part to get created when standard files or data are dragged
  178.     // into OpenDoc, you need to list them here.
  179.     // For instance, if someone drags text or a text file into a container part,
  180.     // we want CyberStarter (since it displays text) to get created. Therefore
  181.     // we list TEXT here.
  182.     //
  183.         kEditor, kODIsPltfmTypeSpac {{
  184.             kODPlatformFileType, kImportMacOSType, smRoman, langEnglish, "Text File", kCategory,
  185.             kODPlatformDataType, kImportMacOSType, smRoman, langEnglish, "Text Data", kCategory
  186.         }}
  187.     }
  188. };
  189.  
  190. //-------------------------------------------------------------------------------------
  191. // Finder Bundle
  192. // I'm putting this here because we can use constants. I know it's a pain. We
  193. // really need a wizard for this kind of thing.
  194. //-------------------------------------------------------------------------------------
  195.  
  196. resource 'BNDL' (128) {
  197.     kPartSignature,
  198.     0, {
  199.         'FREF', { 
  200.             0, 128
  201.         },
  202.         'ICN#', { 
  203.             0, 130
  204.         }
  205.     }
  206. };
  207.  
  208. resource 'BNDL' (129) {
  209.     kODShellSignature, 
  210.     0, {
  211.         'FREF', {
  212.             1, 132,
  213.             2, 133,
  214.             0, 129
  215.         },
  216.         'ICN#', {
  217.             1, 128,
  218.             2, 129,
  219.             0, 131
  220.         }
  221.     }
  222. };
  223.  
  224. resource 'FREF' (128) {
  225.     'shlb',
  226.     0,
  227.     ""
  228. };
  229.  
  230. resource 'FREF' (132) {
  231.     kDocumentIcon,
  232.     1,
  233.     ""
  234. };
  235.  
  236. resource 'FREF' (133) {
  237.     kStationeryIcon,
  238.     2,
  239.     ""
  240. };
  241.  
  242. resource 'FREF' (129) {
  243.     kURLIcon,
  244.     0,
  245.     ""
  246. };
  247.  
  248. type kODShellSignature     { pstring; };
  249. type kPartSignature { pstring; };
  250.  
  251. resource kODShellSignature (0) {
  252.     ""
  253. };
  254.  
  255. resource kPartSignature (0) {
  256.     ""
  257. };
  258.  
  259.